﻿using System;
using System.Runtime.CompilerServices;
using UnityEngine;
using UnityEngine.UI;

public class UIDialogMenuOptionButton : MonoBehaviour
{
    private Button m_button;
    private Text m_text;
    public Action onClick;

    private void Awake()
    {
        this.button.onClick.AddListener(() => this.onClick());
    }

    public Button button
    {
        get
        {
            return ((this.m_button == null) ? (this.m_button = base.GetComponent<Button>()) : this.m_button);
        }
    }

    public int index { get; set; }

    public string label
    {
        get
        {
            return this.text.text;
        }
        set
        {
            this.text.text = value;
        }
    }

    public Text text
    {
        get
        {
            return ((this.m_text == null) ? (this.m_text = base.transform.Find("Text").GetComponent<Text>()) : this.m_text);
        }
    }
}

